package org.smog.core.config.web.model;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.http.HttpStatus;

/**
 * @Description: Created by IntelliJ IDEA.
 * @project_name: smogTemp
 * @time: 2020-05-15 15:13
 * @email: 17685306043@163.com
 * @author: huangZhongYao
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class ApiResponse<E> extends AbstractResponse {

    private static final long serialVersionUID = 7056124818105780616L;

    @ApiModelProperty("接口返回值")
    E result;

    @Override
    public Integer getCode() {
        return HttpStatus.OK.value();
    }

    @Override
    public String getMsg() {
        return super.getMsg() != null ? super.getMsg() : "操作成功";
    }

    @Override
    public Boolean getSuccess() {
        return Boolean.TRUE;
    }
}
